package com.marry.daodaomanage.ui.controller;

import com.marry.daodaomanage.infrastructure.service.WechatMemberService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.oauth2.common.DefaultOAuth2AccessToken;
import org.springframework.security.oauth2.common.OAuth2AccessToken;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.security.PrivateKey;
import java.util.Map;

/**
 * @author mal
 * @date 2022-09-08 14:55
 */
@RestController
@RequestMapping("/wechat-member")
public class WechatMemberController {
    private static final Logger logger = LoggerFactory.getLogger(WechatMemberController.class);

    @Autowired
    private WechatMemberService wechatMemberService;


    @RequestMapping("/page")
    public DefaultOAuth2AccessToken getPageList(@RequestParam(defaultValue = "1") Integer pageNum,
                           @RequestParam(defaultValue = "10") Integer pageSize) {

        DefaultOAuth2AccessToken pageList = wechatMemberService.getPageList(pageNum, pageSize);
        logger.error("" + pageList.getClass());
        return pageList;

    }

    public static class Dto{


        public Dto() {
        }

        private String name;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }
}
